#include "TestScene3.h"

using namespace cocos2d;

CCScene* TestScene3::scene()
{
	CCScene* scene = CCScene::create();

	TestScene3 *layer = TestScene3::create();

	scene->addChild(layer);

	return scene;
}

bool TestScene3::init()
{
	if( !CCLayerColor::initWithColor(ccc4(255,255,0,255)) )
		{
			return false;
		}

	CCMenuItemFont* item1 = CCMenuItemFont::create(
									"Close Scene 3",
									this,
									menu_selector(TestScene3::doClose)
	);
	item1->setColor(ccc3(0,0,0));

	CCMenu* pMenu = CCMenu::create(item1,NULL);

	pMenu->setPosition(ccp(240,50));

	this->addChild(pMenu);

	CCLog("init");

	return true;
}

void TestScene3::onEnter()
{
	CCLayer::onEnter();
	CCLog("onEnter");
}

void TestScene3::onEnterTransitionDidFinish()
{
	CCLayer::onEnterTransitionDidFinish();
	CCLog("onEnterTransitionDidFinish");
}

void TestScene3::onExitTransitionDidStart()
{
	CCLayer::onExitTransitionDidStart();
	CCLog("onExitTransitionDidStart");
}

void TestScene3::onExit()
{
	CCLayer::onExit();
	CCLog("onExit");
}

TestScene3::~TestScene3()
{
	CCLog("dealloc");
}

void TestScene3::doClose(CCObject* pSender)
{
	CCDirector::sharedDirector()->popScene();
}
